using IcsSEMCtrl.Util;
namespace Lifter.Global.Device
{
    public class VehicleTransferStep
    {
        public const int _INIT = 0;
        public const int _START_TO_SOURCE = 1;
        public const int _ARRIVED_AT_SOURCE = 2;
        public const int _LOAD_START = 3;
        public const int _LOAD_COMPLETED = 4;
        public const int _START_TO_DEST = 5;
        public const int _ARRIVED_AT_DEST = 6;
        public const int _UNLOAD_START = 7;
        public const int _UNLOAD_COMPLETED = 8;
        private int _value;
        private static int _size;
        private static VehicleTransferStep[] _array;
        public static string[] displayStrings;
        public static VehicleTransferStep[] displayValues;
        public static VehicleTransferStep INIT;
        public static VehicleTransferStep START_TO_SOURCE;
        public static VehicleTransferStep ARRIVED_AT_SOURCE;
        public static VehicleTransferStep LOAD_START;
        public static VehicleTransferStep LOAD_COMPLETED;
        public static VehicleTransferStep START_TO_DEST;
        public static VehicleTransferStep ARRIVED_AT_DEST;
        public static VehicleTransferStep UNLOAD_START;
        public static VehicleTransferStep UNLOAD_COMPLETED;
        public static VehicleTransferStep IT_ENUM_MAX;
        static VehicleTransferStep()
        {
            VehicleTransferStep._size = 9;
            VehicleTransferStep._array = new VehicleTransferStep[VehicleTransferStep._size];
            VehicleTransferStep.displayStrings = new string[VehicleTransferStep._size];
            VehicleTransferStep.displayValues = new VehicleTransferStep[VehicleTransferStep._size];
            VehicleTransferStep.INIT = new VehicleTransferStep(0);
            VehicleTransferStep.START_TO_SOURCE = new VehicleTransferStep(1);
            VehicleTransferStep.ARRIVED_AT_SOURCE = new VehicleTransferStep(2);
            VehicleTransferStep.LOAD_START = new VehicleTransferStep(3);
            VehicleTransferStep.LOAD_COMPLETED = new VehicleTransferStep(4);
            VehicleTransferStep.START_TO_DEST = new VehicleTransferStep(5);
            VehicleTransferStep.ARRIVED_AT_DEST = new VehicleTransferStep(6);
            VehicleTransferStep.UNLOAD_START = new VehicleTransferStep(7);
            VehicleTransferStep.UNLOAD_COMPLETED = new VehicleTransferStep(8);
            VehicleTransferStep.IT_ENUM_MAX = new VehicleTransferStep(2147483647);
            VehicleTransferStep.displayStrings[0] = "INIT";
            VehicleTransferStep.displayStrings[1] = "START_TO_SOURCE";
            VehicleTransferStep.displayStrings[2] = "ARRIVED_AT_SOURCE";
            VehicleTransferStep.displayStrings[3] = "LOAD_START";
            VehicleTransferStep.displayStrings[4] = "LOAD_COMPLETED";
            VehicleTransferStep.displayStrings[5] = "START_TO_DEST";
            VehicleTransferStep.displayStrings[6] = "ARRIVED_AT_DEST";
            VehicleTransferStep.displayStrings[7] = "UNLOAD_START";
            VehicleTransferStep.displayStrings[8] = "UNLOAD_COMPLETED";
            VehicleTransferStep.displayValues[0] = VehicleTransferStep.INIT;
            VehicleTransferStep.displayValues[1] = VehicleTransferStep.START_TO_SOURCE;
            VehicleTransferStep.displayValues[2] = VehicleTransferStep.ARRIVED_AT_SOURCE;
            VehicleTransferStep.displayValues[3] = VehicleTransferStep.LOAD_START;
            VehicleTransferStep.displayValues[4] = VehicleTransferStep.LOAD_COMPLETED;
            VehicleTransferStep.displayValues[5] = VehicleTransferStep.START_TO_DEST;
            VehicleTransferStep.displayValues[6] = VehicleTransferStep.ARRIVED_AT_DEST;
            VehicleTransferStep.displayValues[7] = VehicleTransferStep.UNLOAD_START;
            VehicleTransferStep.displayValues[8] = VehicleTransferStep.UNLOAD_COMPLETED;
        }
        public static string ValueToString(VehicleTransferStep val)
        {
            string result;
            switch (val.Value())
            {
                case 0:
                    result = VehicleTransferStep.displayStrings[0];
                    break;
                case 1:
                    result = VehicleTransferStep.displayStrings[1];
                    break;
                case 2:
                    result = VehicleTransferStep.displayStrings[2];
                    break;
                case 3:
                    result = VehicleTransferStep.displayStrings[3];
                    break;
                case 4:
                    result = VehicleTransferStep.displayStrings[4];
                    break;
                case 5:
                    result = VehicleTransferStep.displayStrings[5];
                    break;
                case 6:
                    result = VehicleTransferStep.displayStrings[6];
                    break;
                case 7:
                    result = VehicleTransferStep.displayStrings[7];
                    break;
                case 8:
                    result = VehicleTransferStep.displayStrings[8];
                    break;
                default:
                    result = "";
                    break;
            }
            return result;
        }
        public static VehicleTransferStep StringToValue(string val)
        {
            VehicleTransferStep result;
            if (Helper.IsNullOrEmpty(val))
            {
                result = VehicleTransferStep.IT_ENUM_MAX;
            }
            else
            {
                for (int i = 0; i < VehicleTransferStep.displayStrings.Length; i++)
                {
                    if (val.Equals(VehicleTransferStep.displayStrings[i]))
                    {
                        result = VehicleTransferStep.displayValues[i];
                        return result;
                    }
                }
                result = null;
            }
            return result;
        }
        public int Value()
        {
            return this._value;
        }
        public static VehicleTransferStep From_Int(int value)
        {
            VehicleTransferStep result;
            if (value >= 0 && value < VehicleTransferStep._size)
            {
                result = VehicleTransferStep._array[value];
            }
            else
            {
                result = VehicleTransferStep.IT_ENUM_MAX;
            }
            return result;
        }
        protected VehicleTransferStep(int value)
        {
            this._value = value;
            if (value >= 0 && value < VehicleTransferStep._size)
            {
                VehicleTransferStep._array[this._value] = this;
            }
        }
        public bool Equals(VehicleTransferStep otherEnum)
        {
            return otherEnum.Value() == this._value;
        }
        public override string ToString()
        {
            return VehicleTransferStep.displayStrings[this._value];
        }
    }
}
